
UPDATE FLW_ID_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.10.1 (192.168.10.1)', LOCKGRANTED = TIMESTAMP('2019-03-26 21:16:52.699') WHERE ID = 1 AND LOCKED = 0;

UPDATE FLW_ID_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


UPDATE ACT_APP_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.10.1 (192.168.10.1)', LOCKGRANTED = TIMESTAMP('2019-03-26 21:16:53.851') WHERE ID = 1 AND LOCKED = 0;

ALTER TABLE ACT_APP_APPDEF ADD TYPE_ VARCHAR(255);

ALTER TABLE ACT_APP_APPDEF ADD SUB_TYPE_ VARCHAR(255);

ALTER TABLE ACT_APP_APPDEF ADD STATE_ VARCHAR(255);

ALTER TABLE ACT_APP_APPDEF ADD SUB_STATE_ VARCHAR(255);

ALTER TABLE ACT_APP_APPDEF ADD APP_URL_ VARCHAR(255);

CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_APP_APPDEF');

CREATE TABLE ACT_APP_PAGEDEF (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, APP_ID_ VARCHAR(255), NAME_ VARCHAR(255), KEY_ VARCHAR(255) NOT NULL, PAGE_URL_ VARCHAR(255), CONSTRAINT PK_ACT_APP_PAGEDEF PRIMARY KEY (ID_));

INSERT INTO ACT_APP_DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('4', 'flowable', 'org/flowable/app/db/liquibase/flowable-app-db-changelog.xml', CURRENT TIMESTAMP, 3, '7:0dbad89a132929a9cf3c1cf3873c87e7', 'addColumn tableName=ACT_APP_APPDEF; createTable tableName=ACT_APP_PAGEDEF', '', 'EXECUTED', NULL, NULL, '3.5.3', '3631414027');

ALTER TABLE ACT_APP_PAGEDEF ADD APP_KEY_ VARCHAR(255);

ALTER TABLE ACT_APP_PAGEDEF ADD DEPLOYMENT_ID_ VARCHAR(255);

ALTER TABLE ACT_APP_PAGEDEF ADD TENANT_ID_ VARCHAR(255);

CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_APP_PAGEDEF');

INSERT INTO ACT_APP_DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('5', 'flowable', 'org/flowable/app/db/liquibase/flowable-app-db-changelog.xml', CURRENT TIMESTAMP, 4, '7:f3b5fc88b2062632c482e920f8775f53', 'addColumn tableName=ACT_APP_PAGEDEF', '', 'EXECUTED', NULL, NULL, '3.5.3', '3631414027');

UPDATE ACT_APP_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


UPDATE FLW_FO_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.10.1 (192.168.10.1)', LOCKGRANTED = TIMESTAMP('2019-03-26 21:16:54.990') WHERE ID = 1 AND LOCKED = 0;

UPDATE FLW_FO_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


UPDATE FLW_CO_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.10.1 (192.168.10.1)', LOCKGRANTED = TIMESTAMP('2019-03-26 21:16:55.432') WHERE ID = 1 AND LOCKED = 0;

UPDATE FLW_CO_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


UPDATE FLW_AD_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.10.1 (192.168.10.1)', LOCKGRANTED = TIMESTAMP('2019-03-26 21:16:55.893') WHERE ID = 1 AND LOCKED = 0;

UPDATE FLW_AD_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


UPDATE FLW_AU_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.10.1 (192.168.10.1)', LOCKGRANTED = TIMESTAMP('2019-03-26 21:16:56.351') WHERE ID = 1 AND LOCKED = 0;

UPDATE FLW_AU_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


CREATE TABLE FLW_DO_DATABASECHANGELOGLOCK (ID INTEGER NOT NULL, LOCKED SMALLINT NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR(255), CONSTRAINT PK_DBCHGLOGLOCK PRIMARY KEY (ID));

DELETE FROM FLW_DO_DATABASECHANGELOGLOCK;

INSERT INTO FLW_DO_DATABASECHANGELOGLOCK (ID, LOCKED) VALUES (1, 0);

UPDATE FLW_DO_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.10.1 (192.168.10.1)', LOCKGRANTED = TIMESTAMP('2019-03-26 21:16:56.827') WHERE ID = 1 AND LOCKED = 0;

CREATE TABLE FLW_DO_DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED TIMESTAMP NOT NULL, ORDEREXECUTED INTEGER NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255), DEPLOYMENT_ID VARCHAR(10));

CREATE TABLE FLW_DATAOBJECT_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, TENANT_ID_ VARCHAR(255), PARENT_DEPLOYMENT_ID_ VARCHAR(255), CONSTRAINT PK_FLW_DATAOBJECT PRIMARY KEY (ID_));

CREATE TABLE FLW_DO_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_FLW_DO_DEPLOYM PRIMARY KEY (ID_));

CREATE TABLE FLW_DATAOBJECT_DEFINITION (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, KEY_ VARCHAR(128), DEPLOYMENT_ID_ VARCHAR(255) NOT NULL, TENANT_ID_ VARCHAR(64) DEFAULT '', NAME_ VARCHAR(128), VERSION_ INTEGER, RESOURCE_NAME_ VARCHAR(4000), SOURCE_ID_ VARCHAR(128), SOURCE_TYPE_ VARCHAR(128), TYPE_ VARCHAR(128), SUB_TYPE_ VARCHAR(128), EXTERNAL_ID_ VARCHAR(128), CREATION_TIME_ TIMESTAMP NOT NULL, CREATOR_ID_ VARCHAR(64), CONSTRAINT PK_DO_DEFINITIONS PRIMARY KEY (ID_));

ALTER TABLE FLW_DATAOBJECT_DEFINITION ADD CONSTRAINT FK_DATAOBJECT_DEF_DEPLOYMENT FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES FLW_DATAOBJECT_DEPLOYMENT (ID_);

CREATE INDEX IDX_DATAOBJECT_DEF_DEPLOYMENT ON FLW_DATAOBJECT_DEFINITION(DEPLOYMENT_ID_);

CREATE UNIQUE INDEX FLW_IDX_DATAOBJECT_DEF_UNIQ ON FLW_DATAOBJECT_DEFINITION(KEY_, VERSION_, TENANT_ID_);

INSERT INTO FLW_DO_DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('1', 'flowable', 'com/flowable/dataobject/db/liquibase/flowable-dataobject-db-changelog.xml', CURRENT TIMESTAMP, 1, '7:bb4fe641a2be04f665e20bb913a31e3c', 'createTable tableName=FLW_DATAOBJECT_DEPLOYMENT; createTable tableName=FLW_DO_DEPLOYMENT_RESOURCE; createTable tableName=FLW_DATAOBJECT_DEFINITION; addForeignKeyConstraint baseTableName=FLW_DATAOBJECT_DEFINITION, constraintName=FK_DATAOBJECT_DEF_D...', '', 'EXECUTED', NULL, NULL, '3.5.3', '3631416917');

CREATE TABLE FLW_MASTER_DATA_INSTANCE (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, DEFINITION_ID_ VARCHAR(255) NOT NULL, DEFINITION_KEY_ VARCHAR(255) NOT NULL, EXTERNAL_ID_ VARCHAR(128), KEY_ VARCHAR(128), NAME_ VARCHAR(255), STATE_ VARCHAR(64), SORT_ORDER_ INTEGER, IS_FAVORITE_ SMALLINT, DESCRIPTION_ VARCHAR(2000), CREATION_TIME_ TIMESTAMP NOT NULL, CREATOR_ID_ VARCHAR(128), UPDATE_TIME_ TIMESTAMP NOT NULL, UPDATER_ID_ VARCHAR(128), CONSTRAINT PK_DO_DATA_INSTANCES PRIMARY KEY (ID_));

CREATE TABLE FLW_DO_VARIABLES (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, TYPE_ VARCHAR(255), NAME_ VARCHAR(255), DATA_INSTANCE_ID_ VARCHAR(255), BYTEARRAY_ID_ VARCHAR(255), DOUBLE_ DOUBLE, LONG_ BIGINT, TEXT_ VARCHAR(4000), TEXT2_ VARCHAR(4000), CONSTRAINT PK_FLW_DO_VARIABL PRIMARY KEY (ID_));

INSERT INTO FLW_DO_DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('2', 'flowable', 'com/flowable/dataobject/db/liquibase/flowable-dataobject-db-changelog.xml', CURRENT TIMESTAMP, 2, '7:20d4fa181df0c9ae87d703fcb6a1cd2a', 'createTable tableName=FLW_MASTER_DATA_INSTANCE; createTable tableName=FLW_DO_VARIABLES', '', 'EXECUTED', NULL, NULL, '3.5.3', '3631416917');

UPDATE FLW_DO_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


UPDATE FLW_TP_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.10.1 (192.168.10.1)', LOCKGRANTED = TIMESTAMP('2019-03-26 21:16:58.146') WHERE ID = 1 AND LOCKED = 0;

UPDATE FLW_TP_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


UPDATE FLW_ENG_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.10.1 (192.168.10.1)', LOCKGRANTED = TIMESTAMP('2019-03-26 21:16:58.582') WHERE ID = 1 AND LOCKED = 0;

UPDATE FLW_ENG_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;

